package com.xiweicheng.test.jpa;
// Generated 2018-7-14 9:20:43 by Hibernate Tools 5.0.6.Final

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Version;

/**
 * Schedule generated by hbm2java
 */
@Entity
@Table(name = "schedule", catalog = "tms")
public class Schedule implements java.io.Serializable {

	private Long id;
	private long version;
	private Channel channel;
	private Users usersByUpdater;
	private Users usersByCreator;
	private Date createDate;
	private String description;
	private Date endDate;
	private String knowStatus;
	private String place;
	private String priority;
	private Boolean privated;
	private Long remind;
	private Date startDate;
	private String status;
	private String title;
	private String type;
	private Date updateDate;
	private Set<Users> userses = new HashSet<Users>(0);

	public Schedule() {
	}

	public Schedule(String status) {
		this.status = status;
	}

	public Schedule(Channel channel, Users usersByUpdater, Users usersByCreator, Date createDate, String description,
			Date endDate, String knowStatus, String place, String priority, Boolean privated, Long remind,
			Date startDate, String status, String title, String type, Date updateDate, Set<Users> userses) {
		this.channel = channel;
		this.usersByUpdater = usersByUpdater;
		this.usersByCreator = usersByCreator;
		this.createDate = createDate;
		this.description = description;
		this.endDate = endDate;
		this.knowStatus = knowStatus;
		this.place = place;
		this.priority = priority;
		this.privated = privated;
		this.remind = remind;
		this.startDate = startDate;
		this.status = status;
		this.title = title;
		this.type = type;
		this.updateDate = updateDate;
		this.userses = userses;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)

	@Column(name = "id", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Version
	@Column(name = "version", nullable = false)
	public long getVersion() {
		return this.version;
	}

	public void setVersion(long version) {
		this.version = version;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "channel")
	public Channel getChannel() {
		return this.channel;
	}

	public void setChannel(Channel channel) {
		this.channel = channel;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "updater")
	public Users getUsersByUpdater() {
		return this.usersByUpdater;
	}

	public void setUsersByUpdater(Users usersByUpdater) {
		this.usersByUpdater = usersByUpdater;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "creator")
	public Users getUsersByCreator() {
		return this.usersByCreator;
	}

	public void setUsersByCreator(Users usersByCreator) {
		this.usersByCreator = usersByCreator;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "create_date", length = 19)
	public Date getCreateDate() {
		return this.createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	@Column(name = "description", length = 2000)
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "end_date", length = 19)
	public Date getEndDate() {
		return this.endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	@Column(name = "know_status")
	public String getKnowStatus() {
		return this.knowStatus;
	}

	public void setKnowStatus(String knowStatus) {
		this.knowStatus = knowStatus;
	}

	@Column(name = "place")
	public String getPlace() {
		return this.place;
	}

	public void setPlace(String place) {
		this.place = place;
	}

	@Column(name = "priority")
	public String getPriority() {
		return this.priority;
	}

	public void setPriority(String priority) {
		this.priority = priority;
	}

	@Column(name = "privated")
	public Boolean getPrivated() {
		return this.privated;
	}

	public void setPrivated(Boolean privated) {
		this.privated = privated;
	}

	@Column(name = "remind")
	public Long getRemind() {
		return this.remind;
	}

	public void setRemind(Long remind) {
		this.remind = remind;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "start_date", length = 19)
	public Date getStartDate() {
		return this.startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	@Column(name = "status", nullable = false)
	public String getStatus() {
		return this.status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	@Column(name = "title")
	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@Column(name = "type")
	public String getType() {
		return this.type;
	}

	public void setType(String type) {
		this.type = type;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "update_date", length = 19)
	public Date getUpdateDate() {
		return this.updateDate;
	}

	public void setUpdateDate(Date updateDate) {
		this.updateDate = updateDate;
	}

	@ManyToMany(fetch = FetchType.LAZY)
	@JoinTable(name = "actor_schedule", catalog = "tms", joinColumns = {
			@JoinColumn(name = "schedule_id", nullable = false, updatable = false) }, inverseJoinColumns = {
					@JoinColumn(name = "user_id", nullable = false, updatable = false) })
	public Set<Users> getUserses() {
		return this.userses;
	}

	public void setUserses(Set<Users> userses) {
		this.userses = userses;
	}

}
